<!-- 合同签署 -->
<template>
  <div class="step4">
    <a-form :model="formData" style="width: 700px" ref="refStep4Form" :rules="{
        way: [
          {
            required: true,
            message: '请选择'
          }
        ],
        overTime: [
          {
            required: true,
            message: '请选择'
          }
        ],
        expire: [
          {
            required: true,
            message: '请选择'
          }
        ],
        signature: [
          {
            required: true,
            message: '请选择'
          }
        ],
        remind: [
          {
            required: true,
            message: '请选择'
          }
        ]
      }" auto-label-width>
      <a-form-item label="合同确认截止日期" field="overTime" show-colon>
        <a-date-picker v-model="formData.overTime" />
      </a-form-item>
      <a-form-item label="确认截止日期未确认将视为" field="expire" show-colon>
        <a-radio-group v-model="formData.expire">
          <a-radio :value="1">默认通过</a-radio>
          <a-radio :value="2">不通过</a-radio>
        </a-radio-group>
      </a-form-item>
      <a-form-item label="合同签署有效时间" field="signature" show-colon>
        <a-date-picker v-model="formData.signature" />
      </a-form-item>
      <a-form-item label="签署有效期前" field="remind">
        <a-input-number v-model="formData.remind" style="width: 150px; margin: 0 10px" allow-clear hideButton button-text="Search" :min="1">
          <template #append>
            <span>天</span>
          </template>
        </a-input-number>
        进行提醒
      </a-form-item>
    </a-form>
  </div>
</template>

<script setup lang="ts">
let formData = reactive<any>({});
const refStep4Form = ref();
defineExpose({
  async getData() {
    if (await refStep4Form.value.validate()) return Promise.reject('数据错误');
    return { ...formData };
  },
  setData(data: any) {
    Object.assign(formData, data); //表单数据
  }
});
</script>

<style lang="less" scoped>
.step4 {
  width: 800px;
  margin: 0 auto;
  padding-top: 50px;
}
</style>
